﻿<Window x:Class="personalplaner.gui.common.views.LoginDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:c="clr-namespace:personalplaner.common.controls;assembly=personalplaner.common"
        xmlns:p="clr-namespace:personalplaner.gui.Properties"
        xmlns:vm="clr-namespace:personalplaner.common.mvvm.factory;assembly=personalplaner.common"
        xmlns:fac="clr-namespace:personalplaner.gui.common.viewmodels.factories"
        vm:ViewModelLoader.FactoryType="{x:Type fac:LoginDialogModelFactory}"
        Icon="/personalplaner.gui;component/resources/images/Personalplaner.ico"
        ShowInTaskbar="True"
        ResizeMode="NoResize"
        SizeToContent="WidthAndHeight"
        WindowStartupLocation="CenterScreen" 
        Title="Personalplaner"
        AllowsTransparency="True"
        WindowStyle="None"
        Background="Transparent">

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/personalplaner.common;component/resources/styles/WhiteStyleTemplates.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Border CornerRadius="30" BorderBrush="#FFE3E4E7" Background="#FFE3E4E7"  Margin="4">
            <!--#FFDDDDDD-->
            <!--#FFFFFFFF-->
            <Border.Effect>
                <BlurEffect Radius="15" />
            </Border.Effect>
        </Border>


        <Border CornerRadius="30" BorderBrush="#FFDDDDDD" BorderThickness="2.5"  Margin="8">
            <!--3-->
            <Border.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Color="White" Offset="0"/>
                        <GradientStop Color="White" Offset="0.6"/>
                        <GradientStop Color="#FFEDEDED" Offset="1"/>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Border.Background>

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="60"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition Width="350"/>
                    <ColumnDefinition Width="150"/>
                </Grid.ColumnDefinitions>

                <Grid Grid.Row="0" Grid.RowSpan="4" Grid.ColumnSpan="3" Margin="0">
                    <!--<Image Source="/Sage200.X3connect.Resources;component/Images/X3connect.Header.png" HorizontalAlignment="Left" VerticalAlignment="Top" Height="28" Margin="10,10,0,0"/>
                    <Image Source="/Sage200.X3connect.Resources;component/Images/Sage.Logo_2.png" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="35" Grid.Row="2" Grid.Column="2" Margin="8,0,10,10"/>-->
                </Grid>

                <!--<Border BorderBrush="Gray" BorderThickness="1" Background="Transparent" CornerRadius="5" >-->
                <c:CollapsibleGroupBox Title="Benuzer" IsCollapseable="False"  Padding="10,5,10,10" Margin="0,0,0,5" SnapsToDevicePixels="True" Grid.Row="1" Grid.Column="1">
                    <Grid Margin="0,0,5,0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>

                        <Label Grid.Row="0">
                            <TextBlock Text="Benutzer"/>
                        </Label>
                        <Label Grid.Row="1">
                            <TextBlock Text="Passwort"/>
                        </Label>

                        <TextBox Grid.Row="0" Grid.Column="1" Margin="1" Text="{FocusBinding LoginData.UserName}" />
                        <PasswordBox Grid.Row="1" Grid.Column="1" Margin="1" x:Name="txtPassword" LostFocus="Text_LostFocus" KeyDown="Password_KeyDown"/>
                    </Grid>
                </c:CollapsibleGroupBox>

                <Grid Grid.Row="2" Grid.Column="1">
                    <CheckBox IsChecked="{Binding LoginData.SavePassword}" Margin="0,12,0,0" VerticalAlignment="Top">
                        <TextBlock Text="{x:Static p:Resources.PasswortSpeichern}" />
                    </CheckBox>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,0,10">
                        <Button Margin="6" Width="70" HorizontalAlignment="Right" IsDefault="True" Command="{Binding OkCommand}">
                            <TextBlock Text="Ok" VerticalAlignment="Center"/>
                        </Button>
                        <Button Margin="6" MinWidth="70" HorizontalAlignment="Right" Click="Cancel_Click" IsCancel="True">
                            <TextBlock Text="Abbrechen" VerticalAlignment="Center"/>
                        </Button>
                    </StackPanel>
                </Grid>

                <!--<Border BorderBrush="Gray" BorderThickness="1" Background="Transparent" CornerRadius="5" Margin="0,0,0,15" SnapsToDevicePixels="True" Grid.Row="3" Grid.Column="1">-->
                    <c:CollapsibleGroupBox Title="Datenbank" IsCollapseable="True" IsCollapsed="True" Padding="10,5,10,10" Margin="0,0,0,15" SnapsToDevicePixels="True" Grid.Row="3" Grid.Column="1">
                        <Grid Margin="0,0,5,0" >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <!--<RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />-->
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>

                            <Label Grid.Row="0">
                                <TextBlock Text="ODBC"/>
                            </Label>
                            <Label Grid.Row="1">
                                <TextBlock Text="Datenbank"/>
                            </Label>

                        <ComboBox Grid.Row="0" Grid.Column="1" Margin="1" ItemsSource="{Binding OdbcList}" SelectedItem="{Binding SelectedOdbc}" />
                        <ComboBox Grid.Row="1" Grid.Column="1" Margin="1" ItemsSource="{Binding DatabaseList}" SelectedItem="{Binding LoginData.Database}" />
                            <!--<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Text="{Binding Sage200_Mandid}" />
                            <TextBox Grid.Row="3" Grid.Column="1" Margin="1" Text="{Binding Sage200_GJ}" />-->


                        </Grid>
                    </c:CollapsibleGroupBox>

                <!--</Border>-->

            </Grid>
        </Border>

    </Grid>
    
</Window>
